<!-- indexController.php -->
<?php 
	require 'Controller.php';
	require 'Home/Model/IndexModel.php';				
	class IndexController extends Controller{
		function __Construct(){
			parent::__Construct();
			$this->model = new indexModel();
		}

		function index(){
			$data1 = $this->model->getfoodtype();
			$this->assign('foodtype',$data1);

			$data2 = $this->model->gethittimes();
			$this->assign('foodhittimes',$data2);
			
			$data3 = $this->model->getfoodinfor();
			$this->assign('foodinfor',$data3);

			$this->display();
		}

		function lists(){
			$id=$_GET['id'];
			$data1 = $this->model->getfoodtype();
			$this->assign('foodtype',$data1);
			

			$data2 = $this->model->gethittimes();
			$this->assign('foodhittimes',$data2);

			$data3 = $this->model->getfoodinfor();
			$this->assign('foodinfor',$data3);

			$data4 = $this->model->getfoodlist($id);
			$this->assign('foodlist',$data4);


			$this->display();
		}

		function show(){
			$id=$_GET['id'];
			$data1 = $this->model->getfoodtype();
			$this->assign('foodtype',$data1);

			$data2 = $this->model->getfoodinfor();
			$this->assign('foodinfor',$data2);

			$data3 = $this->model->getfoodshow($id);
			$this->assign('foodshow',$data3);

			$this->display();
		}
	}
 ?>